package com.yunhai.xc.lina.base;

public class AjaxResult {
	private boolean success = true;
	private int code = ConstantCode.SUCCESS_CODE;
	private String msg = "操作成功";
	private String title = "成功";
	private Object data;

	public AjaxResult() {
	}

	public AjaxResult(String title, String msg) {

		this.title = title;
		this.msg = msg;
		this.success = true;
		this.code = ConstantCode.SUCCESS_CODE;
	}

	public AjaxResult(Object data) {
		this.data = data;
	}

	public AjaxResult(boolean success, int code, String msg) {
		super();
		this.success = success;
		this.code = code;
		this.msg = msg;
	}

	public AjaxResult(boolean success, int code, String title, String msg, Object data) {
		this.success = success;
		this.code = code;
		this.title = title;
		this.msg = msg;
		this.data = data;
	}

	public boolean isSuccess() {
		return this.success;
	}

	@Override
	public String toString() {
		return "AjaxResult [success=" + success + ", code=" + code + ", msg=" + msg + ", title=" + title + ", data="
				+ data + "]";
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

}
